<template>
  <el-input size="small" v-model="value"></el-input>
  <el-button size="small" @click="changeBig">转小写</el-button>
</template>
<script lang="ts" setup>
import { watch, ref } from 'vue';

const props = defineProps(['modelValue'])
const emits = defineEmits(['update:modelValue'])
const value = ref()
watch(() => props.modelValue,(val) => {
  value.value = val
},{
  immediate: true
})
const changeBig = () => {
  let result = value.value?.toLowerCase()
  console.log(result)
  // value.value = result
  emits('update:modelValue', result)
}

</script>